<HTML xmlns:z>
  
 
 <HEAD>
  <TITLE> New Document </TITLE>
  <META HTTP-EQUIV="pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" 	src="../../js/jquery.pack.js"></script>
	<script type="text/javascript"  src="../../js/riaframework.js"></script>
	<script type="text/javascript"  src="../../js/ssb.js"></script>
    <link href="../../css/cssCn.css" rel="stylesheet" type="text/css"> 
</HEAD>
 <script type="text/javascript">
function ShowTable(imgCtrl)
{
	var ImgPlusScr ="../../images/icon_expandall.gif"	;      	// Plus  +
	var ImgMinusScr ="../../images/icon_collapseall.gif"	;	// Minus - 
 	var TableID = imgCtrl.id.replace("Img","Table");
 	var tableCtrl = document.getElementById(TableID);
 				 
 	if(imgCtrl.src.indexOf("icon_expandall") != -1)
 	{
 		tableCtrl.style.display ="";
 		imgCtrl.src = ImgMinusScr ;
 	}
    else
 	{	
 		tableCtrl.style.display ="none";
 		imgCtrl.src = ImgPlusScr ;		 
 	}
} 		  
/////////////////////////////////////////////////////
var ren = {};
function getConfigData()
{
   callUrl('appLogFacade/getAppLogPolicy.ssm', null,'ren','true');
   var config = ren.rtnValue;
   var enabled = document.getElementById("enabled");
   selectProcess(enabled, config.enabled);
   var handletype = document.getElementById("handletype");
   selectProcess(handletype, config.handletype);
   var remaindays = document.getElementById("remaindays");
   if(config.remaindays != null)
   {
      remaindays.value = config.remaindays;
   }
}
function selectProcess(reTagObject, value)
{
    var sel_children = reTagObject.getElementsByTagName("option");
     //将控件的prop属性值和下拉选项的value值对比，如果相等则选中
     for(var j = 0; j < sel_children.length; j ++ )
     {
     	if(new String(value) == sel_children[j].value)//如果prop属性值和option.value相等
     	{
     		sel_children[j].selected = "selected";
     	}
     }
}     
     
addOnloadEvent(getConfigData);
//////////////////////////////////////////////////
var flag = {};
var appmodel ={};
 function save()
 {
 var obj = document.getElementById("remaindays");
 if(Number(obj.value))
 {
    alert("保留天数只能输入大于零的整数!");
    obj.focus();
    return false;
 }

    appmodel.enabled = document.getElementById("enabled").value;
    appmodel.handletype = document.getElementById("handletype").value;
    appmodel.remaindays = document.getElementById("remaindays").value;
    callUrl('appLogFacade/updateAppLogPolicy.ssm', 'appmodel','flag','true');
    
    if(flag.rtnValue == true)
    {
       alert("保存成功!");
    }
    else if(flag.rtnValue == false)
    {
       alert("保存失败");
    }
 }

  </script>
<BODY>
	
<z:binds>
    <z:bind ctrl="getAccountname"  ref="obj1.name" />
	<z:bind ctrl="getAccountId"  ref="obj1.employeeId" />
    <z:bind ctrl="getAccountId"  ref="obj1.employeeId" />
</z:binds>
<z:service id='getAccountInfo' method='post' url='tableFacade/getPageData.ssm'>
	<z:request onRequest=''  offRequest=''/>
	<z:response rtn=''  onResponse='' offResponse='' onerror=''/>
</z:service>
<DIV id=overDiv style="POSITION: absolute; Z-INDEX: 1"></DIV>
<table width="100%" border="0">
   <tr>
     <td><div align="left" class="div_subtitle">当前位置：系统管理<span class="arrow_subtitle">&gt;</span>日志管理<span class="arrow_subtitle">&gt;</span>业务日志策略</div></td>
   </tr>
 </table>
<TABLE align=center width="100%" border="0"  cellPadding=0 cellSpacing=0 id=tb_content>
  <TBODY>
    <TR>
      <TD vAlign=top>

           <table width="100%" border="0" class="tb_titlebar">
            <tbody>
             <tr>
               <td><a href="#"><img src="../../images/icon_collapseall.gif" name="Img1" width="16" height="16" border="0" 
class="icon" id="Img1"  onclick="ShowTable(this);"></a>业务日志处理策略</td>
             </tr>
             </tbody>
           </table>
           <TABLE class=tb_input cellSpacing=1 width="100%" id="DEBUG2">
              <TBODY>
                
                <TR>
                  <TD width="16%" noWrap class="td_title">启用业务日志</TD>
                  <TD width="34%">
                  <select name="select" style="width:80px" id="enabled">
                    <option value="Y">是</option>
                    <option value="N">否</option>
                  </select>                  </TD>
                  <TD width="16%" nowrap class="td_title">日志处理方式</TD>
                  <TD width="34%">
                  <select name="select3" style="width:80px" id="handletype">
				    <option value="0">不处理</option>
                    <option value="1">定时归档</option>
                    <option value="2">定时清除</option>
                  </select></TD>         
                </TR>
                <TR>
                  <TD width="17%" class="td_title" nowrap>日志处理策略</TD>
                  <TD colspan="3">保留
                  <input id="remaindays" name=staydays  style="WIDTH: 50px" size="10">天内活动日志
				  </TD>
				</TR>
                    </TBODY>
          </TABLE>
          
           <div align="right" class="div_no">
             <input name="Submit" type="button" class="button" onclick="save()" value="保存">
           </div>

</TD>
</TR>
</TBODY>
</TABLE>

</BODY>
</HTML>
